package org.tinygroup.flow.impl;

import java.util.HashMap;
import java.util.Map;

import org.tinygroup.flow.config.SubFlow;

public abstract class SubFlowManagerImpl extends ComponentManagerImpl{
	private Map<String, SubFlow> map =new HashMap<String, SubFlow>();

	public void assemble(){
		for (SubFlow flow : map.values()) {
			flow.assemble();
		}
	}
	
	public void addSubFlow(SubFlow subFlow){
		map.put(subFlow.getId(),subFlow);
	}

	public void removeSubFlow(SubFlow subFlow){
		removeSubFlow(subFlow.getId());
	}

	public void removeSubFlow(String subFlowId){
		map.remove(subFlowId);
	}

	public SubFlow getSubFlow(String subFlowId){
		return map.get(subFlowId);
	}
	
	public Map<String, SubFlow> getSubFlowIdMap(){
		return map;
	} 
}
